<!DOCTYPE html>

<html lang="en">
<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
  <meta name="baidu-site-verification" content="GOgEP8c1pN"/>
  

  <title>
    搭建开发环境_Django博客教程_追梦人物的博客</title>

  <link href="font-awesome.min.css"
        rel="stylesheet">
  <link rel="stylesheet" href="mobi.min.css">
  <link rel="stylesheet" href="modal.min.css">
  <link rel="stylesheet" href="friendly.css">
  <link rel="stylesheet" href="blog.css?v0.12">
  <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  <script src="/static/blog/js/menu.js"></script>
  <script src="/static/blog/js/modal.min.js"></script>
  <script src="/static/blog/js/blog.js"></script>
  

  
    <script>
        // baidu statistics
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?fb59b2a6022bccc02671a750f61c356b";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();

        // baidu auto push
        (function () {
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>
    
  
</head>
<body class="bg-light">
<header>
  <nav class="flex-center bg-white nav-bar">
    <div class="container-wider flex-middle">
      
  <a class="show-on-mobile nav-link m-5" id="js-sidebar-btn" href="#" role="button">
    <i class="fa fa-chevron-right" aria-hidden="true"></i>
  </a>

      <a class="nav-bar-logo mr-7" href="/">
        <img src="/static/blog/images/logo.png" alt="blog logo">
      </a>
      <ul class="unit-0 hide-on-mobile nav-bar-nav">
        <li class="nav-item mr-7">
          <a class="nav-link" href="/">首页</a>
        </li>
        <li class="nav-item mr-7">
          <a class="nav-link" href="/tutorials/">教程</a>
        </li>
        <li class="nav-item mr-7">
          <a class="nav-link" href="/categories/">分类</a>
        </li>
        <li class="nav-item mr-7">
          <a class="nav-link" href="/archives/">归档</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="/donate/">赞助</a>
        </li>
      </ul>
      <div class="unit flex-right flex-middle">
        <form class="hide-on-mobile flex-left flex-middle search-form mr-5" id="search-form"
              action="/search/">
          <input class="unit" type="search" name="q" placeholder="搜索..."/>
          <button class="unit-0" type="submit" role="button">
            <i class="fa fa-search" aria-hidden="true"></i>
          </button>
        </form>
        <a class="show-on-mobile nav-link fs-7 mr-7" id="js-search-btn" href="#" role="button">
          <i class="fa fa-search" aria-hidden="true"></i>
        </a>
        <div class="flex-middle notification">
          
            <a class="nav-link" href="/accounts/login/">
              <i class="fa fa-sign-in" aria-hidden="true"></i>
            </a>
          
        </div>
        <div class="show-on-mobile flex-middle">
          <a class="nav-link fs-7 ml-7 mr-5" id="menu-toggle" href="#">
            <i class="fa fa-ellipsis-v" aria-hidden="true"></i>
          </a>
          <ul class="menu bg-white" data-menu data-menu-toggle="#menu-toggle">
            <li class="nav-item mr-7">
              <a class="nav-link" href="/">首页</a>
            </li>
            <li>
              <a href="/tutorials/">教程</a>
            </li>
            <li>
              <a href="/categories/">分类</a>
            </li>
            <li>
              <a href="/archives/">归档</a>
            </li>
            <li>
              <a href="/donate/">赞助</a>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </nav>
</header>
<section class="flex-center">
  <div class="container-wider">
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
              &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">设置评论回复接收邮箱</h4>
            <div class="text-primary mt-2">邮箱仅用于接收回复提醒，不会被公开。</div>
            
          </div>
          <div class="modal-body">
            <form class="form email-binding-form" action="/comments/ajax_email_binding/">
              <div class="message">
                <span class="text-danger"></span>
              </div>
              <input type='hidden' name='csrfmiddlewaretoken' value='Pgdpz2BJRI1l8PgQzGcnUwp86bE3PzrYFL64N7khSIRAVHuPLjFbwrl5PcpRzwMg' />
              <div class="flex-left units-gap">
                <label class="unit-0 text-right" for="multiple-inputs-name">邮箱: </label>
                <div class="unit">
                  <input type="email" name="email" id="id_email" placeholder="请输入绑定邮箱"/>
                </div>
                <div class="unit-0">
                  <button class="btn" id="js-send" type="button"
                          data-target="/comments/ajax_verification_code/">发送验证码
                  </button>
                </div>
              </div>
              <div class="flex-left units-gap">
                <label class="unit-0 text-right" for="multiple-inputs-name">验证码: </label>
                <div class="unit">
                  <input type="text" name="verification_code" id="id_verification_code"
                         placeholder="请输入接收到的验证码"/>
                </div>
              </div>
              <div class="flex-right">
                <button type="button" class="btn btn-danger mr-3" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary" id="js-submit">设置</button>
              </div>
            </form>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal -->
    </div>
    <div class="flex-left flex-wrap "
         style="margin-top: 60px">
      
  <aside class="unit-1-4 unit-1-on-mobile top-gap">
    <div class="scroll-view bg-white card toc-sidebar" style="height: 100%">
      <div class="card-header">
        目录
      </div>
      <div class="flex-left">
        <div class="unit-1-4">
          <a href="https://promotion.aliyun.com/ntms/act/group/team.html?group=FcfAncJPAp" target="_blank"><img
              src="/static/blog/images/aliyun.jpg" alt=""></a>
        </div>
        <div class="unit-1-2 flex-vertical top-gap text-small">
          <a style="color: #e83e8c" target="_blank"
             href="https://promotion.aliyun.com/ntms/act/group/team.html?group=FcfAncJPAp">云服务器新用户</a>
          <a style="color: #6610f2" target="_blank"
             href="https://promotion.aliyun.com/ntms/act/group/team.html?group=FcfAncJPAp">8元/月</a>
        </div>
      </div>
      <div class="card-body">
        <ul>
          <li>
            <h6 class="top-gap-0"><a href="">Django博客教程</a></h6>
            <ul>
              
                <li>
                  <a href="2.html">前言</a>
                  
                </li>
              
                <li>
                  <a href="3.html">搭建开发环境</a>
                  
                    <div class="toc">
<ul>
<li><a href="#本教程使用的开发环境">本教程使用的开发环境</a></li>
<li><a href="#安装-python">安装 Python</a></li>
<li><a href="#使用虚拟环境-virtualenv">使用虚拟环境 Virtualenv</a></li>
<li><a href="#安装-django">安装 Django</a></li>
<li><a href="#建立-django-工程">建立 Django 工程</a></li>
<li><a href="#hello-django">Hello Django</a></li>
<li><a href="#总结">总结</a></li>
</ul>
</div>

                  
                </li>
              
                <li>
                  <a href="4.html">建立 Django 博客应用</a>
                  
                </li>
              
                <li>
                  <a href="5.html">创建 Django 博客的数据库模型</a>
                  
                </li>
              
                <li>
                  <a href="6.html">让 Django 完成翻译：迁移数据库</a>
                  
                </li>
              
                <li>
                  <a href="7.html">Django 博客首页视图</a>
                  
                </li>
              
                <li>
                  <a href="8.html">真正的 Django 博客首页视图</a>
                  
                </li>
              
                <li>
                  <a href="9.html">在 Django Admin 后台发布文章</a>
                  
                </li>
              
                <li>
                  <a href="10.html">博客文章详情页</a>
                  
                </li>
              
                <li>
                  <a href="11.html">支持 Markdown 语法和代码高亮</a>
                  
                </li>
              
                <li>
                  <a href="12.html">页面侧边栏：使用自定义模板标签</a>
                  
                </li>
              
                <li>
                  <a href="13.html">分类与归档</a>
                  
                </li>
              
                <li>
                  <a href="14.html">评论</a>
                  
                </li>
              
                <li>
                  <a href="16.html">已知小问题修正</a>
                  
                </li>
              
                <li>
                  <a href="20.html">使用 Nginx 和 Gunicorn 部署 Django 博客</a>
                  
                </li>
              
                <li>
                  <a href="21.html">使用 Fabric 自动化部署</a>
                  
                </li>
              
                <li>
                  <a href="29.html">统计文章阅读量</a>
                  
                </li>
              
                <li>
                  <a href="32.html">自动生成文章摘要</a>
                  
                </li>
              
                <li>
                  <a href="33.html">基于类的通用视图：ListView 和 DetailView</a>
                  
                </li>
              
                <li>
                  <a href="34.html">Django Pagination 简单分页</a>
                  
                </li>
              
                <li>
                  <a href="37.html">Django Pagination 完善分页</a>
                  
                </li>
              
                <li>
                  <a href="38.html">统计各个分类下的文章数</a>
                  
                </li>
              
                <li>
                  <a href="39.html">标签云</a>
                  
                </li>
              
                <li>
                  <a href="41.html">RSS 订阅</a>
                  
                </li>
              
                <li>
                  <a href="43.html">Markdown 自动生成文章目录</a>
                  
                </li>
              
                <li>
                  <a href="44.html">简单全文搜索</a>
                  
                </li>
              
                <li>
                  <a href="45.html">Django Haystack 全文检索与关键词高亮</a>
                  
                </li>
              
            </ul>
          </li>
        </ul>
      </div>
    </div>
  </aside>

      
  <div class="unit-3-4 unit-1-on-mobile top-gap">
    


<div class="bg-white card post-card px-7 py-5">
  
<article class="post">
  <h1 class="top-gap-0">搭建开发环境</h1>
  <ul class="list-inline dot-divider post-meta">
    <li class="list-inline-item text-small text-muted">
      1 年前
    </li>
    <li class="list-inline-item text-small text-muted">5681 字
    </li>
    <li class="list-inline-item text-small text-muted">
      53781 阅读
    </li>
    <li class="list-inline-item text-small text-muted">
      41 评论
    </li>
  </ul>
  <div class="top-gap-big post-body">
    <h2 id="本教程使用的开发环境">本教程使用的开发环境</h2>
<p>本教程写作时开发环境的系统平台为 Windows 10 （64 位），Python 版本为 3.5.2 （64 位），Django 版本为 1.10.6。</p>
<p>建议尽可能地与教程的开发环境保持一致（尤其是 Python 与 Django 版本），避免不必要的麻烦。推荐的 Python 版本为 Python 3.4 或以上，Django 版本号必须为 Django 1.10.x。</p>
<p><strong>注意：本教程将尽量保证兼容 Python 2，但不会在 Python 2 环境下做测试。如果你因为某种原因必须使用 Python 2，你可以在 Python 2 环境下尝试运行教程里的代码，应该能够顺利运行。</strong></p>
<h2 id="安装-python">安装 Python</h2>
<p>Windows 下安装 Python 非常简单，去 Python 官方网站找到 Python 3 的下载地址，根据你的系统选择 32 位或者 64 位的安装包，下载好后双击安装即可。</p>
<p>安装完后检测 Python 是否可以正常运行。在命令行输入 <code>python -v</code> ，如果输出了 Python 的版本号，说明 Python 已安装成功。</p>
<div class="codehilite"><pre><span></span>C:\WINDOWS\system32&gt;python -V
Python 3.5.2
</pre></div>


<p>如果提示命令未找到，而你又确定已经安装了 Python，多半是因为没有把 Python 添加到环境变量。可搜索如何把 Python 添加到环境变量的相关教程，将安装的Python 添加到环境变量即可。</p>
<h2 id="使用虚拟环境-virtualenv">使用虚拟环境 Virtualenv</h2>
<p><strong>强烈推荐在 Virtualenv 下进行 Django 的开发。</strong>Virtualenv 是一个 Python 工具，使用它可以创建一个独立的 Python 环境。</p>
<p>为什么要使用 Virtualenv 呢？举个例子，假设你已经在系统中安装了 Python，并且在阅读此教程前你已经进行过一些 Django 的学习，但那时候安装的 Django 还是 1.8 版本。我们教程使用的是最新版的 Django 1.10.6 版本，你可能不愿意删除掉旧版的 Django 1.8，因为那可能导致你以前的项目无法运行。既想让原本项目在 Django 1.8 环境下运行，又想再安装 Django 1.10.6 来开启本教程的项目，怎么办呢？使用 Virtualenv 就能够完美解决这个问题。</p>
<p>Virtualenv 帮我们从系统的 Python 环境中克隆一个全新的 Python 环境出来，这个环境独立于原来的 Python 环境。我们可以在这个新克隆的环境下安装 Django 1.10.6，并且在这个新环境下运行我们的新项目。</p>
<p>Virtualenv 的使用非常简单，首先安装 Virtualenv，打开命令行工具，输入 <code>pip install virtualenv</code> 命令即可安装 Virtualenv。</p>
<div class="codehilite"><pre><span></span>C:\WINDOWS\system32&gt;pip install virtualenv
</pre></div>


<p>安装成功后就可以开始创建虚拟环境，指定一个你喜欢的目录，Virtualenv 会把这个新的虚拟环境装到你指定目录下。例如我把它装到 C:\Users\yangxg\Envs 目录下，并将虚拟环境命名为 blogproject_env（也可以取任何你喜欢的名字）。在命令栏运行如下命令：</p>
<div class="codehilite"><pre><span></span>C:\WINDOWS\system32&gt;virtualenv C:\Users\yangxg\Envs\blogproject_env
</pre></div>


<p>虚拟环境已经创建好了，我们需要激活这个环境，运行 blogproject_env\Scripts\ 目录下的 activate 程序激活它：</p>
<div class="codehilite"><pre><span></span>C:\WINDOWS\system32&gt;C:\Users\yangxg\Envs\blogproject_env\Scripts\activate
(blogproject_env) C:\WINDOWS\system32&gt;
</pre></div>


<p><strong>注意 Linux 下没有 Scripts\ 这个目录，取而代之的是 bin/ 目录。且激活命令为：</strong></p>
<div class="codehilite"><pre><span></span>$ <span class="nb">source</span> blogproject_env/bin/activate
</pre></div>


<p>可以看到命令提示符前面多了 (blogproject_env)，说明我们已经成功激活了虚拟环境，接下来就可以开始安装 Django 了。</p>
<h2 id="安装-django">安装 Django</h2>
<p>Django 的官方文档对 <a href="https://docs.djangoproject.com/en/1.10/intro/install/#install-django">如何安装 Django</a> 给出了详细且明确的指导，不过我们目前用不上这些，只需使用 pip 命令就可以解决问题。</p>
<div class="codehilite"><pre><span></span>(blogproject_env) C:\WINDOWS\system32&gt;pip install django==1.10.6
</pre></div>


<p>我们用 django==1.10.6 来安装指定的 Django 版本以保证和教程中的一致。如果直接 <code>pip install django</code> 的话有可能安装最新的 Django 发行版本，而不是 Django 1.10.6。</p>
<p><strong>注意命名提示符前的 (blogproject_env) 以确保你始终处在虚拟环境中，如果不小心退出了虚拟环境，先按上面的步骤重新进入再安装 Django。</strong></p>
<p>测试一下安装是否成功，先在命令行输入 <code>python</code> 以打开 Python 自带的命令栏，然后输入 <code>import django</code>，如果没有报错就说明 Django 安装成功。通过运行 <code>print(django.get_version())</code> 打印出 Django 的版本号，确保安装了正确版本的 Django。</p>
<div class="codehilite"><pre><span></span><span class="p">(</span><span class="n">blogproject_env</span><span class="p">)</span> <span class="n">C</span><span class="p">:</span>\<span class="n">WINDOWS</span>\<span class="n">system32</span><span class="o">&gt;</span><span class="n">python</span>
<span class="n">Python</span> <span class="mf">3.5</span><span class="o">.</span><span class="mi">2</span> <span class="p">(</span><span class="n">v3</span><span class="o">.</span><span class="mf">5.2</span><span class="p">:</span><span class="mi">4</span><span class="n">def2a2901a5</span><span class="p">,</span> <span class="n">Jun</span> <span class="mi">25</span> <span class="mi">2016</span><span class="p">,</span> <span class="mi">22</span><span class="p">:</span><span class="mi">18</span><span class="p">:</span><span class="mi">55</span><span class="p">)</span> <span class="p">[</span><span class="n">MSC</span> <span class="n">v</span><span class="o">.</span><span class="mi">1900</span> <span class="mi">64</span> <span class="n">bit</span> <span class="p">(</span><span class="n">AMD64</span><span class="p">)]</span> <span class="n">on</span> <span class="n">win32</span>
<span class="n">Type</span> <span class="s2">&quot;help&quot;</span><span class="p">,</span> <span class="s2">&quot;copyright&quot;</span><span class="p">,</span> <span class="s2">&quot;credits&quot;</span> <span class="ow">or</span> <span class="s2">&quot;license&quot;</span> <span class="k">for</span> <span class="n">more</span> <span class="n">information</span><span class="o">.</span>
<span class="o">&gt;&gt;&gt;</span> <span class="kn">import</span> <span class="nn">django</span>
<span class="o">&gt;&gt;&gt;</span> <span class="k">print</span><span class="p">(</span><span class="n">django</span><span class="o">.</span><span class="n">get_version</span><span class="p">())</span>
<span class="mf">1.10</span><span class="o">.</span><span class="mi">6</span>
<span class="o">&gt;&gt;&gt;</span>
</pre></div>


<h2 id="建立-django-工程">建立 Django 工程</h2>
<p>万事已经具备了，让我们来建立 Django 项目工程。 </p>
<p>Django 工程（Project）是我们项目代码的容器，例如我们博客项目中所有的代码（包括 Django 为我们自动生成的以及我们自己写的）都包含在这个工程里。其实说通俗一点就是用一个文件夹把一系列 Python 代码文件和 Django 配置文件包裹起来，这个文件夹就可以看做一个 Django 工程。我们不必亲自动手新建这个文件夹和代码文件，Django 的内置命令已经帮我们做了这些事情。例如我把博客工程的代码放在 C:\Users\yangxg\Workspace\ ，工程名我把它叫做 blogproject 。</p>
<p>首先在命令行进入到 C:\Users\yangxg\Workspace 这个目录（如果你还停留在 Python 的命令栏里，先多按几次 Ctrl + c 键跳出来）：</p>
<div class="codehilite"><pre><span></span>(blogproject_env) C:\WINDOWS\system32&gt;cd C:\Users\yangxg\Workspace
</pre></div>


<p>然后运行如下命令创建工程：</p>
<div class="codehilite"><pre><span></span>(blogproject_env) C:\Users\yangxg\Workspace&gt;django-admin startproject blogproject
</pre></div>


<p><strong>再次申明一定要在虚拟环境下运行这些命令，虚拟环境的标志就是命令提示符前有 (blogproject_env) 这样的标记。以后几乎所有和 Django 有关的命令都是在虚拟环境下运行，因此在运行前一定确保先开启了虚拟环境。</strong></p>
<p>进入工程所在目录 C:\Users\yangxg\Workspace\（你可能设置在其它路径），会发现多了一个 blogproject\ 的目录，其内部的文件结构如下：</p>
<div class="codehilite"><pre><span></span>blogproject\
    manage.py
    blogproject\
        __init__.py
        settings.py
        urls.py
        wsgi.py
</pre></div>


<p>最顶层的 blogproject\ 目录是我们刚刚指定的工程目录。blogproject\ 目录下面有一个 manage.py 文件，manage 是管理的意思，顾名思义 manage.py 就是 Django 为我们生成的管理这个项目的 Python 脚本文件，以后用到时会再次介绍。与 manage.py 同级的还有一个 blogproject\ 的目录，这里面存放了一些 Django 的配置文件，例如 settings.py、urls.py 等等，以后用到时会详细介绍。</p>
<h2 id="hello-django">Hello Django</h2>
<p>网站需要运行在一个 Web 服务器上，Django 已经为我们提供了一个用于本地开发的 Web 服务器。在命令行工具里进入到 manage.py 所在目录，即<strong>最外层</strong>的 blogproject\ 目录下。运行 <code>python manage.py runserver</code> 命令就可以在本机上开启一个 Web 服务器：</p>
<div class="codehilite"><pre><span></span>(blogproject_env) C:\Users\yangxg\Workspace&gt;cd C:\Users\yangxg\Workspace\blogproject

(blogproject_env) C:\Users\yangxg\Workspace\blogproject&gt;python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run &#39;python manage.py migrate&#39; to apply them.
December 21, 2016 - 20:23:07
Django version 1.10.4, using settings &#39;blogproject.settings&#39;
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
</pre></div>


<p>看到这样的信息表明我们的服务器开启成功。</p>
<p>在浏览器输入 http://127.0.0.1:8000/ ，看到如下的页面提示信息：</p>
<p><img alt="Welcome to Django" src="//bkt.zmrenwu.com/Welcome%20to%20Django.png" /></p>
<p>It worked!  Django 工作了！</p>
<p><strong>注意：如果在浏览器输入 http://127.0.0.1:8000/ 后显示无法访问该网站，请检查是不是浏览器代理的问题。比如开启了某些 VPN 代理服务等，将它们全部关闭即可。</strong></p>
<p>这是 manage.py 的第一个用法，运行它的 <code>runserver</code> 命令开启本地开发服务器，以后我们还会遇到更多的命令。</p>
<p>命令栏工具下按 Ctrl + c 可以退出开发服务器（按一次没用的话连续多按几次）。重新开启则再次运行 <code>python manage.py runserver</code> 。</p>
<p>Django 默认的语言是英语，所以显示给我们的欢迎页面是英文的。我们在 Django 的配置文件里稍作修改，让它支持中文。用任何一个文本编辑器打开 settings.py 文件，找到如下的两行代码：</p>
<div class="codehilite"><pre><span></span><span class="n">blogproject</span><span class="o">/</span><span class="n">blogproject</span><span class="o">/</span><span class="n">settings</span><span class="o">.</span><span class="n">py</span>

<span class="c1">## 其它配置代码...</span>

<span class="n">LANGUAGE_CODE</span> <span class="o">=</span> <span class="s1">&#39;en-us&#39;</span>
<span class="n">TIME_ZONE</span> <span class="o">=</span> <span class="s1">&#39;UTC&#39;</span>

<span class="c1">## 其它配置代码...</span>
</pre></div>


<p>把 <code>LANGUAGE_CODE</code> 的值改为 <code>zh-hans</code>，<code>TIME_ZONE</code> 的值改为 <code>Asia/Shanghai</code>：</p>
<div class="codehilite"><pre><span></span><span class="n">blogproject</span><span class="o">/</span><span class="n">blogproject</span><span class="o">/</span><span class="n">settings</span><span class="o">.</span><span class="n">py</span>

<span class="c1">## 其它配置代码...</span>

<span class="c1"># 把英文改为中文</span>
<span class="n">LANGUAGE_CODE</span> <span class="o">=</span> <span class="s1">&#39;zh-hans&#39;</span>

<span class="c1"># 把国际时区改为中国时区</span>
<span class="n">TIME_ZONE</span> <span class="o">=</span> <span class="s1">&#39;Asia/Shanghai&#39;</span>

<span class="c1">## 其它配置代码...</span>
</pre></div>


<p><strong>保存更改后</strong>关闭 settings.py 文件。</p>
<p>再次运行开发服务器，并在浏览器打开 http://127.0.0.1:8000/，可以看到 Django 已经支持中文了。</p>
<p><img alt="欢迎认识 Django" src="//bkt.zmrenwu.com/%E6%AC%A2%E8%BF%8E%E8%AE%A4%E8%AF%86%20Django.png" /></p>
<p>一切准备就绪，开始进入我们的 Django 博客开发之旅吧！</p>
<h2 id="总结">总结</h2>
<p>本章节的代码位于：<a href="https://github.com/zmrenwu/django-blog-tutorial/tree/Step1_build-development-environment">Step1: build development environment</a>。</p>
<p>如果遇到问题，请通过下面的方式寻求帮助。</p>
<ul>
<li>在下方评论区留言。</li>
<li>将问题的详细描述通过邮件发送到 djangostudyteam@163.com，一般会在 24 小时内回复。</li>
<li>在 <a href="http://www.pythonzh.cn/category/newbie-qa/">Pythonzhcn 社区的新手问答版块</a> 发布帖子。</li>
</ul>
    <p class="text-center">
      -- EOF --
    </p>
    <div>
      <button class="btn btn-primary" id="js-reward"><i class="fa fa-jpy"
                                                        aria-hidden="true"></i>
        如果觉得文章对你有帮助，请随意打赏
        <i class="fa fa-chevron-down" aria-hidden="true"></i>
      </button>
      <div class="flex-left flex-wrap units-gap-big mt-4" style="display: none">
        <div class="unit unit-1-on-mobile flex-center">
          <figure>
            <img src="/static/blog/images/weixinpay.jpg" alt="微信支付收款二维码"
                 style="width: 250px">
            <figcaption class="text-center fs-6 mt-2" style="color: green">微信</figcaption>
          </figure>
        </div>
        <div class="unit unit-1-on-mobile flex-center">
          <figure>
            <img src="/static/blog/images/alipay.jpg" alt="支付宝收款二维码" style="width: 250px">
            <figcaption class="text-center fs-6 mt-2 text-primary">支付宝</figcaption>
          </figure>
        </div>
      </div>
    </div>
    <div class="post-tags">
      <ul class="list-inline">
        
      </ul>
    </div>
  </div>
</article>
  <div class="top-gap">
    <div class="jiathis_style">
      <span class="jiathis_txt">分享到：</span>
      <a class="jiathis_button_qzone">QQ空间</a>
      <a class="jiathis_button_tsina">新浪微博</a>
      <a class="jiathis_button_tqq">腾讯微博</a>
      <a class="jiathis_button_weixin">微信</a>
      <a href="http://www.jiathis.com/share?uid=2128865"
         class="jiathis jiathis_txt jiathis_separator jtico jtico_jiathis"
         target="_blank">更多</a>
      <a class="jiathis_counter_style"></a>
    </div>
    <script type="text/javascript">
        var jiathis_config = {data_track_clickback: 'true'};
    </script>
    <script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=2128865"
            charset="utf-8"></script>
    <!-- JiaThis Button END -->
  </div>
  <br>
  <div class="top-gap clearfix">
    
    
      <a class="float-right" href="4.html">
        建立 Django 博客应用
        <i class="fa fa-angle-double-right" aria-hidden="true"></i>
      </a>
    
  </div>
  

  <section class="comment-area top-gap-big" id="comment-area">
    <h5>41 条评论 / 21 人参与</h5>
    
      
<div class="flex-center top-gap login-panel p-7">
  <div>
    <div class="text-muted text-center login-header"><span>登录后回复</span></div>
    <div class="flex-center text-center social-icons mt-3">
                        <span class="weibo mr-3">
                            <a href="/accounts/weibo/login/">
                                <i class="fa fa-weibo" aria-hidden="true"></i>
                            </a>
                        </span>
      <span class="github">
                            <a href="/accounts/github/login/">
                                <i class="fa fa-github" aria-hidden="true"></i>
                            </a>
                        </span>
    </div>
  </div>
</div>
    
    <div class="top-gap-big comment-list">
  
    <div class="flex-left py-4" id="c2375">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars3.githubusercontent.com/u/37708280?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">chouat
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>新人一枚.</p><p>python版本3.6</p><p>django版本2.0.3</p><p>根据步骤,安装运行虚拟环境,建立项目均正常.(结构目录及DOS命令行前的虚拟标记均符合教程所说),唯独运行"python manage.py runserver"时报错.内容如下:</p><p>Traceback (most recent call last):&nbsp;</p><p>&nbsp;File "manage.py", line 8, in &lt;module&gt;&nbsp; &nbsp;&nbsp;</p><p>from django.core.management import execute_from_command_line&nbsp;</p><p>ModuleNotFoundError: No module named 'django'&nbsp;</p><p>The above exception was the direct cause of the following exception:&nbsp;</p><p>&nbsp;Traceback (most recent call last):&nbsp;&nbsp;</p><p>File "manage.py", line 14, in &lt;module&gt;&nbsp; &nbsp; ) from exc</p><p>&nbsp;ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?<br></p><p>看错误提示,貌似是无法导入Django?是否配置环境变量?是否激活虚拟环境.</p><p>忘解答,不胜感激.</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">2 周，1 日前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2375"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c2376">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars3.githubusercontent.com/u/37708280?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">chouat
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">chouat
        

  </header>
  <div class="comment-body">
    <p>看了官方文档,问题已经解决了.博主说的,对,官方文档很有用.</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">2 周，1 日前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2376"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c2354">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/20892308?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">William Li
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>条理非常清楚，谢了！</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">3 周，1 日前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2354"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c2346">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="http://tva1.sinaimg.cn/crop.0.0.750.750.180/71474077jw8enws25i7zgj20ku0kuq4h.jpg"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">为什么需要起名字
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>环境搭建成功，打卡<br></p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">3 周，5 日前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2346"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c2326">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars3.githubusercontent.com/u/33922869?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">gengjinpeng
          
        </span>
    
  </header>
  <div class="comment-body">
    <p style="">买了本《python编程从入门到实践》，但是讲的没看明白。</p><p style="">今天根据博主的步骤，终于搞定。继续！！！<br></p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">1 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2326"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c2321">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars0.githubusercontent.com/u/33627543?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">laysyal
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>楼主，想问一下我安装的django==1.10.1安装不上，老是显示timeout，后来我将版本号给去掉，但是后续的汉化操作好像没有用，这个有影响吗？</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">1 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2321"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c2267">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars3.githubusercontent.com/u/29800726?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">何睿
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>"GET /favicon.ico HTTP/1.1" 404 1941。我什么都还没动，这是个什么错误啊</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">1 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2267"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c1797">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="http://tva1.sinaimg.cn/crop.0.0.720.720.180/83e7c779jw8ewgvkveoikj20k00k0js1.jpg"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">吃的太多了呀
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>博主，我安装django时出现了这个问题：</p><p>(blogProject_env) C:\Users\Administrator.CXREVL7GFCBU590&gt;pip install django==1.10.6Collecting django==1.10.6&nbsp;<span style="color: rgb(227, 55, 55);"> Could not find a version that satisfies the requirement django==1.10.6 (from versions: )No matching distribution found for django==1.10.6</span><br></p><p>想求助一下，是因为我在配置环境时添加了<font color="#e33737">“--no-setuptools”</font>的原因吗？</p><p>非常感谢！！</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">4 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1797"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c1798">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="http://tva1.sinaimg.cn/crop.0.0.720.720.180/83e7c779jw8ewgvkveoikj20k00k0js1.jpg"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">吃的太多了呀
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">吃的太多了呀
        

  </header>
  <div class="comment-body">
    <p>解决啦。就是之前安装不完整的问题。</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">4 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1798"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c2355">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/20892308?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">William Li
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">吃的太多了呀
        

  </header>
  <div class="comment-body">
    <p>具体怎么弄的？</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">3 周，1 日前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2355"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c1663">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="http://tva2.sinaimg.cn/crop.0.0.400.400.180/741de8fdjw8fcibbh7fcgj20b40b4mxp.jpg"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">螺蛳Rose
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>执行python&nbsp;manage.py&nbsp;runserver报错，自己弄了好久未能解决，求支招</p><hr><p>(projectName) C:\python\code\blogproject&gt;python manage.py runserver&nbsp;</p><p>Performing system checks...System check identified no issues (0 silenced).&nbsp;</p><p>&nbsp;You have 13 unapplied migration(s). Your project may not work properly until yo&nbsp;apply the migrations for app(s): admin, auth, contenttypes, sessions.&nbsp;</p><p>Run 'python manage.py migrate' to apply them.&nbsp;</p><p>October 26, 2017 - 17:31:26&nbsp;</p><p>Django version 1.10.6, using settings 'blogproject.settings'&nbsp;</p><p>Starting development server at <a href="http://127.0.0.1:8000/" rel="nofollow">http://127.0.0.1:8000/</a>&nbsp;</p><p>Quit the server with CTRL-BREAK.&nbsp;</p><p>Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.wrappe&nbsp;at 0x02D16588&gt;&nbsp;</p><p>Traceback (most recent call last):&nbsp;&nbsp;</p><p>File "C:\python\env\projectName\lib\site-packages\django\utils\autoreload.py"&nbsp;line 226, in wrapper&nbsp; &nbsp; fn(*args, **kwargs)&nbsp;&nbsp;</p><p>File "C:\python\env\projectName\lib\site-packages\django\core\management\commnds\runserver.py", line 144, in inner_run&nbsp; &nbsp; ipv6=self.use_ipv6, threading=threading)&nbsp;&nbsp;</p><p>File "C:\python\env\projectName\lib\site-packages\django\core\servers\basehtt.py", line 183, in run&nbsp; &nbsp; httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)&nbsp;&nbsp;</p><p>File "C:\python\env\projectName\lib\site-packages\django\core\servers\basehtt.py", line 76, in __init__&nbsp; &nbsp; super(WSGIServer, self).__init__(*args, **kwargs)&nbsp;</p><p>&nbsp;File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\soketserver.py", line 453, in __init__&nbsp; &nbsp; self.server_bind()&nbsp;&nbsp;</p><p>File "C:\python\env\projectName\lib\site-packages\django\core\servers\basehtt.py", line 80, in server_bind&nbsp; &nbsp; super(WSGIServer, self).server_bind()&nbsp;&nbsp;</p><p>File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\wsiref\simple_server.py", line 50, in server_bind&nbsp; &nbsp; HTTPServer.server_bind(self)&nbsp;&nbsp;</p><p>File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\htp\server.py", line 138, in server_bind&nbsp; &nbsp; self.server_name = socket.getfqdn(host)&nbsp;&nbsp;</p><p>File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\soket.py", line 673, in getfqdn&nbsp; &nbsp; hostname, aliases, ipaddrs = gethostbyaddr(name)&nbsp;</p><p><span style="color: rgb(227, 55, 55);">UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 8: invalidstart byte</span><br></p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">5 月，1 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1663"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c1670">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">螺蛳Rose
        

  </header>
  <div class="comment-body">
    <p>编码问题，这个问题比较难定位，尝试着删了项目重新创建试试。</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">5 月，1 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1670"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c2135">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/35287608?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">zhienzhou
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">螺蛳Rose
        

  </header>
  <div class="comment-body">
    <p>我也碰到了同样的问题，windows7 python3.5/3.6都试了，还是同样的错误，之前看到stackover上有个类似的问题，解决方式是hostname中不要包含ASCII码里没有的字符，我看了下自己的hostname，也没有呀。目前还是无解状态。</p><p>错误提示：</p><pre><code>(VirtualEnv) D:\Users\zhouze\workspace\django-test\mysite&gt;python manage.py runserver<br />Performing system checks...<br /><br />System check identified no issues (0 silenced).<br />January 10, 2018 - 14:00:26<br />Django version 2.0.1, using settings 'mysite.settings'<br />Starting development server at http://127.0.0.1:8000/<br />Quit the server with CTRL-BREAK.<br />Unhandled exception in thread started by &lt;function check_errors.&lt;locals&gt;.wrapper at 0x0000000004C46A60&gt;<br />Traceback (most recent call last):<br />&nbsp; File "D:\Users\zhouze\workspace\django-test\VirtualEnv\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper<br />&nbsp; &nbsp; fn(*args, **kwargs)<br />&nbsp; File "D:\Users\zhouze\workspace\django-test\VirtualEnv\lib\site-packages\django\core\management\commands\runserver.py", line 143, in inner_run<br />&nbsp; &nbsp; ipv6=self.use_ipv6, threading=threading, server_cls=self.server_cls)<br />&nbsp; File "D:\Users\zhouze\workspace\django-test\VirtualEnv\lib\site-packages\django\core\servers\basehttp.py", line 163, in run<br />&nbsp; &nbsp; httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)<br />&nbsp; File "D:\Users\zhouze\workspace\django-test\VirtualEnv\lib\site-packages\django\core\servers\basehttp.py", line 66, in __init__<br />&nbsp; &nbsp; super().__init__(*args, **kwargs)<br />&nbsp; File "c:\program files\python35\Lib\socketserver.py", line 440, in __init__<br />&nbsp; &nbsp; self.server_bind()<br />&nbsp; File "c:\program files\python35\Lib\wsgiref\simple_server.py", line 51, in server_bind<br />&nbsp; &nbsp; HTTPServer.server_bind(self)<br />&nbsp; File "c:\program files\python35\Lib\http\server.py", line 140, in server_bind<br />&nbsp; &nbsp; self.server_name = socket.getfqdn(host)<br />&nbsp; File "c:\program files\python35\Lib\socket.py", line 663, in getfqdn<br />&nbsp; &nbsp; hostname, aliases, ipaddrs = gethostbyaddr(name)<br />UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte<br></code></pre>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">2 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/2135"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c1546">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/32156913?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">fan93
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>输入django-admin 会报下面的错误</p><p>Fatal error in launcher: Unable to create process using '"'<br></p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">6 月，1 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1546"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c1368">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars0.githubusercontent.com/u/20089093?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">edsszw
          
        </span>
    
  </header>
  <div class="comment-body">
    <p>python3无需安装virtualenv</p><p>只需要</p><p>python3 -m venv projectName</p><p>windows下</p><p>.\Scripts\activate.bat</p><p>Linux下：</p><p>source ./bin/activate</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">7 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1368"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c1369">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">edsszw
        

  </header>
  <div class="comment-body">
    <p>受教！以前virtualenv用惯了，事实上python3确实已经自带 venv</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">7 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1369"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c1371">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars0.githubusercontent.com/u/20089093?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">edsszw
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    <p>没有没有，我才是一直在受教。。。只是分享一下自己知道的一点东西而已。</p>
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">6 月，4 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1371"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c1051">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="http://tva2.sinaimg.cn/crop.0.100.400.400.180/aa7e4bfejw8e7ffi6g8e1j20b40godga.jpg"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">唯J王道
          
        </span>
    
  </header>
  <div class="comment-body">
    今天开始了我的blog之旅 mark一下 无限支持博主！
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">7 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1051"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c1028">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/20086528?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Liangyanlong
          
        </span>
    
  </header>
  <div class="comment-body">
    6666666
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">7 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/1028"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c851">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="http://tva1.sinaimg.cn/crop.0.0.1080.1080.180/705f298bjw8ek2ezpu0c5j20u00u0414.jpg"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">dxdhmz
          
        </span>
    
  </header>
  <div class="comment-body">
    我如果就在虚拟机中操作，是不是就不需要虚拟环境了？
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">8 月，1 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/851"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c891">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">dxdhmz
        

  </header>
  <div class="comment-body">
    取决于个人习惯了，如果虚拟机中也有多个项目，设置虚拟环境也是不错的。当然这不是本质问题，只要开发起来方便即可。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">8 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/891"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c831">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars3.githubusercontent.com/u/29860665?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">smilexnan
          
        </span>
    
  </header>
  <div class="comment-body">
    第一章打卡
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">8 月，2 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/831"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
        <div class="comment-descendant-list">
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c100">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars0.githubusercontent.com/u/25062009?v=3"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">xiaobeibei26
          
        </span>
    
  </header>
  <div class="comment-body">
    exec ../env/bin/gunicorn --bind unix:/tmp/demo.zmrenwu.com.socket blogproject.wsgi:application<br />楼主你好，上面env前面的路径我怎么也调不好，每次都是Jab failed to start，那两个点是什么意思啊，我文件跟目录位置跟你不一样的，我中间多了一个文件，楼主可以解答一下这个路径怎么解决吗
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">10 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/100"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c101">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">xiaobeibei26
        

  </header>
  <div class="comment-body">
    换成你自己的路径，../ 表示上一级目录。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">10 月，3 周前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/101"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c40">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/28527786?v=3"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">liuchengfei
          
        </span>
    
  </header>
  <div class="comment-body">
    django-admin startproject blogproject  后   看不见Workspace下有文件
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/40"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c41">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/28527786?v=3"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">liuchengfei
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">liuchengfei
        

  </header>
  <div class="comment-body">
    找到了  电脑磁盘的问题
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/41"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
      <hr class="m-0">
    
  
    <div class="flex-left py-4" id="c16">
      <div class="unit-0">
        <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
      </div>
      <div class="unit">
        <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
  </header>
  <div class="comment-body">
    问一下，我创建好虚拟环境为什么找不到activate
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/16"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>
        
          <hr class="">
        
        <div class="comment-descendant-list">
          
            <div class="flex-left py-4" id="c20">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    Linux 的话在 bin/active 下。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/20"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c22">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    我用的也是win10
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/22"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c23">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    仔细找找。有可能是你的虚拟环境创建失败了，重新创建试试。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/23"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c31">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    是虚拟环境创建错了。<br />我用的是virtualenv test --no-setuptools --no-pip --no-wheel 这样才创建好
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/31"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c44">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    为什么我虚拟环境安装的Django不是在虚拟环境的lib目录，而是在Python的目录，在虚拟环境运行不了Django怎么办
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/44"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c48">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    是不是没有激活虚拟环境？能把你操作的主要过程描述一下么。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/48"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c59">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    激活虚拟环境了，但是安装Django不是在我虚拟环境的目录里，在python的目录里，我退出虚拟环境可以import django，在虚拟环境里import django就会提示没有Django
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/59"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c61">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    从你的现象分析来看就是没有在虚拟环境中安装 django。但是你说已经激活虚拟环境，这就不好说了。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/61"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c62">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    我在虚拟环境下运行pip list里面显示已经有Django，但是在虚拟环境进入python却没有Django
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/62"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c63">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    这说明你进去的 shell 环境不是这个虚拟环境的。可能是命令搞错了。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/63"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c64">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/27345832?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">Xiang99
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">追梦人物
        
            <span class="master">[博主]</span>
        

  </header>
  <div class="comment-body">
    能留个联系方式吗，我给你看图片
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/64"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c65">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/13174219?v=4"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">追梦人物
          
            <span class="master">[博主]</span>
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    加群 561422498
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">11 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/65"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c374">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars2.githubusercontent.com/u/5275092?v=3"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">谷瑑
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    试试 virtualenv -p 指定python 二进制文件。
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">10 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/374"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
              <hr class="m-0">
            
          
            <div class="flex-left py-4" id="c617">
              <div class="unit-0">
                <img class="comment-avatar mr-3" src="https://avatars1.githubusercontent.com/u/26563807?v=3"/>
              </div>
              <div class="unit">
                
  <div class="comment-main">
  <header class="comment-user">
        <span class="text-small text-muted nickname">wenmingxing1
          
        </span>
    
    <span class="reply-label text-small text-muted">
                                                        <i class="fa fa-share" aria-hidden="true"></i>
                                                    </span>
    <span class="nickname text-small text-muted">Xiang99
        

  </header>
  <div class="comment-body">
    我和你的情况一样，请问你是怎么解决的呢？
  </div>
  <footer class="comment-footer flex-left">
    <ul class="unit list-inline dot-divider">
      <li class="list-inline-item">
        <time class="text-small text-muted">9 月前</time>
      </li>
      <li class="list-inline-item">
        <a href="/comments/reply/617"
           class="reply-btn text-small text-muted">回复</a>
      </li>
    </ul>
  </footer>
</div>

              </div>
            </div>
            
          
        </div>
      </div>
    </div>
    
  
</div>
  </section>
</div>
  </div>

    </div>
  </div>
</section>
<footer class="bg-white py-5 mt-5 text-small text-muted">
  <div class="flex-center">
    <div>&copy; 2017 追梦人物的博客</div>
  </div>
  
  
  
</footer>
<script>
    $('[data-menu]').menu();

    var InterValObj; //timer变量，控制时间
    var curCount = 120;//当前剩余秒数

    $('#js-send').on('click', function (event) {
        var $this = $(this);
        var $targetURL = $this.attr('data-target');
        $.post(
            $targetURL,
            {email: $('#id_email').val()},
            function (data) {
                if (data.ok) {
                    $this.attr("disabled", "true");
                    $this.text("重新发送验证码" + "(" + curCount + ")");
                    InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次
                    $('.message')
                        .find('span')
                        .text(data.msg)
                } else {
                    $('.message').find('span').text(data.msg)
                }
            }
        );
        return false;
    });

    //timer处理函数
    function SetRemainTime() {
        if (curCount === 0) {
            window.clearInterval(InterValObj);//停止计时器
            $('#js-send').removeAttr("disabled");//启用按钮
            $('#js-send').text("重新发送验证码");
        }
        else {
            curCount--;
            $('#js-send').text("重新发送验证码" + "(" + curCount + ")");
        }
    }

    $('#js-submit').on('click', function (event) {
        var $this = $(this);
        var $form = $('.email-binding-form');
        var $targetURL = $form.attr('action');
        console.log($targetURL);

        $.post(
            $targetURL,
            {
                email: $('#id_email').val(),
                verification_code: $('#id_verification_code').val()
            },
            function (data) {
                if (data.ok) {
                    location.reload();
                } else {
                    $('.message')
                        .find('span')
                        .text(data.msg)
                }
            }
        );
        return false;
    });


    var editor = new Simditor({
        textarea: $('#id_comment'),
        placeholder: "提出你的见解...",
        toolbarFloat: false,
        cleanPaste: true,
        toolbar: [
            'bold',
            'italic',
            'underline',
            'strikethrough',
            'color',
            'ol',
            'ul',
            'blockquote',
            'code',
            'table',
            'link',
            'image',
            'hr'
        ]
    });
</script>


</body>
</html>